//
//  BigData.m
//  22-AliPlanet_HomeWork
//
//  Created by 曹曹 on 16/8/12.
//  Copyright © 2016年 曹曹. All rights reserved.
//

#import "BigData.h"
#import "BigAction.h"
#import "LittleData.h"

@implementation BigData
- (void)setValue:(id)value forKey:(NSString *)key {
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"id"]) {
        _ID = value;
    }
    if ([key isEqualToString:@"action"]) {
        _action = [BigAction modelWithDictionary:value];
    }
    if ([key isEqualToString:@"data"]) {
        NSMutableArray *array = [NSMutableArray array];
        for (NSDictionary *dictionary in value) {
            LittleData *data = [LittleData modelWithDictionary:dictionary];
            [array addObject:data];
        }
        _data = array;
    }
}
@end
